<?PHP

	class tpl_globals {
		
		public static function header(){
			
			$message = '';
			if(isset($GLOBALS['OUTPUT']->message))
				$message = <<<EOV
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_roomcp->information}</div>
<div class='box_container'>
	<div class='infobox_inside'>{$GLOBALS['OUTPUT']->message}</div>
</div>
<br />
EOV;
			
			$class = array();
			foreach(array('tools','appearance','settings','management') as $section){
				$class[$section] = $GLOBALS['OUTPUT']->master_section == $section ? 'tab_active' : 'tab_norm';
			}

			$menu = '';
			foreach($GLOBALS['OUTPUT']->cpmenu as $label=>$action){
				if($action == 'header'){
					$menu .= "<div class='menu_header'>".$label."</div>";
				}else{
					$menu .= "<div class='".($GLOBALS['OUTPUT']->minor_section == $label ? 'menu_item_active' : 'menu_item_norm')."' onmouseout=\"this.className=this.className.replace('_hover','_norm');\" onmouseover=\"this.className=this.className.replace('_norm','_hover');\" onclick=\"document.location='".$action.$GLOBALS['OUTPUT']->ses."'\">".$label."</div>";
				}
			}
			
			return <<<EOF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="content-type" value="text/html; charset=UTF-8" />
		<meta name='author' content='X7 Group' />
		<style type='text/css'>
			body {
				background: #ccd1d7;
				color: #42494f;
				font-family: arial, helvetica, sans-serif;
				font-size: 12px;
				margin: 0px;
				padding: 0px;
			}
			
			a {
				color: #24517F;
				text-decoration: none;
			}
		
			a:hover {
				color: #3981CB;
				text-decoration: underline;
			}
			
			.tabbar {
				background: url(./themes/admin/images/tabbar_bg.png);
				height: 65px;
				width: 100%;
			}
			
			.tab_norm, .tab_active, .tab_over {
				background: url(./themes/admin/images/tab.png);
				background-position: 0px 0px;
				padding-top: 15px;
				height: 25px;
				width: 125px;
				text-align: center;
				font-size: 14px;
				font-weight: bold;
				margin-left: 10px;
				cursor: pointer;
				float: right;
			}
			
			.tab_over {
				background: url(./themes/admin/images/tab.png);
				background-position: 0px 40px;
			}
			
			.tab_active {
				background: url(./themes/admin/images/tab.png);
				background-position: 0px 81px;
				color: white;
			}
			
			.logo {
				color: #3b85d1;
				font-weight: bold;
				font-size: 24px;
				float: left;
				width: 140px;
				margin-left: 10px;
				margin-top: 5px;
				letter-spacing: 1px;
			}
			
			.menu_block {
				width: 200px;
				border: 1px solid #797b7f;
				border-top: 0px;
				float: left;
				margin-right: 8px;
			}
		
			.menu_item_norm, .menu_item_hover, .menu_item_active {
				background: url(./themes/default/images/dropdown_menu_bg.png);
				font-size: 12px;
				padding: 2px;
				padding-left: 20px;
				height: 16px;
				cursor: pointer;
				color: #24517F;
			}
			
			.menu_item_hover, .menu_item_active {
				background-position: 0px -21px;
				color: white;
			}
			
			.menu_header {
				border-top: 1px solid #797b7f;
				text-align: center;
				font-weight: bold;
				font-size: 12px;
				background: url(./themes/admin/images/dropdown_menu_bg.png) #ccd1d7;
				background-position: 0px -42px;
				height: 16px;
				padding: 2px;
			}
			
			.table_header {
				background: url(./themes/admin/images/table_header_bg.png) #ccd1d7;
				border: 1px solid #797b7f;
				border-bottom: 0px;
				height: 23px;
				padding-top: 7px;
				font-weight: bold;
				font-size: 14px;
			}
			
			table {
				border: 1px solid #797b7f;
				background: white;
			}
			
			.td1 {
				background: #EAECF0;
			}
			
			.td2 {
				background: #e2e7ea;
			}
			
			.input_box, .input_box_focus, select {
				border: 1px solid #797b7f;
				margin: 0px;
				padding: 2px;
				background: white;
				color: #42494f;
				font-size: 12px;
				position: relative;
				top: -1px;
				width: 300px;
			}
			
			.input_box_focus {
				border: 1px solid #4295EC;
			}
			
			.form_button_norm, .form_button_over {
				border: 0px;
				margin: 0px;
				padding: 0px;
				padding-top: 1px;
				background: url(./themes/admin/images/button.png);
				height: 29px;
				width: 85px;
				cursor: pointer;
				color: black;
				font-weight: bold;
				font-size: 12px;
			}
		
			.form_button_over {
				background-position: 0px 30px;
				color: white;
			}

			.small_error_text {
				font-size: 10px;
				color: #e02828;
			}

			.instructions {
				font-size: 10px;
			}

			.box_container {
				background: white;
				border: 1px solid #797b7f;
			}
			
			.infobox_inside {
				background: #e2e7ea;
				margin: 1px;
				padding: 5px;
			}

			.table_header_row {
				background: #D3D9DE !important;
				font-weight: bold;
			}
		</style>
	</head>
	<body>
	<div class='tabbar'>		
		<div class='logo'>X7 Chat 3</div>
		<div style='float: right;width: 100px;'>&nbsp;</div>
		<div class='tab_norm' onclick="window.open('http://help.x7chat.com/?v=3&skin=full&section=admin');" onmouseover="this.className=this.className.replace('norm','over');" onmouseout="this.className=this.className.replace('over','norm');">Help</div>
		<div class='{$class['tools']}' onclick="document.location='./index.php?act=admin{$GLOBALS['OUTPUT']->ses}&page=tools'" onmouseover="this.className=this.className.replace('norm','over');" onmouseout="this.className=this.className.replace('over','norm');">{$GLOBALS['LANG']->lang_admin->tools}</div>
		<div class='{$class['appearance']}' onclick="document.location='./index.php?act=admin{$GLOBALS['OUTPUT']->ses}&page=appearance'" onmouseover="this.className=this.className.replace('norm','over');" onmouseout="this.className=this.className.replace('over','norm');">{$GLOBALS['LANG']->lang_admin->appearance}</div>
		<div class='{$class['settings']}' onclick="document.location='./index.php?act=admin{$GLOBALS['OUTPUT']->ses}&page=settings'" onmouseover="this.className=this.className.replace('norm','over');" onmouseout="this.className=this.className.replace('over','norm');">{$GLOBALS['LANG']->lang_admin->settings}</div>
		<div class='{$class['management']}' onclick="document.location='./index.php?act=admin{$GLOBALS['OUTPUT']->ses}&page=management'" onmouseover="this.className=this.className.replace('norm','over');" onmouseout="this.className=this.className.replace('over','norm');">{$GLOBALS['LANG']->lang_admin->management}</div>
	</div>
	<div style='float: left; width: 200px; margin: 15px;'>
		<div class='menu_block'>
			{$menu}
		</div>
	</div>
	<div style='background: #E3E8EF; margin: 15px;margin-left: 230px; border: 1px solid #797b7f;'>
		<div style='padding: 10px;'>
		{$message}
EOF;
		}

		public static function footer(){
			return <<<EOF
			</div>
	</div>
	<div style='clear: both'></div>
	<br />
	<div style='margin-top: 40px;font-size: 10px;text-align: center;position: relative;z-index: 100;'>{$GLOBALS['OUTPUT']->copyright}</div>

	</body>
</html>
EOF;
		}
		
	}

?>